﻿@model FPP.Models.PoolType
@{
    ViewBag.Title = string.Format("Famous People Pool - Details about game {0}", Model.Name);
}
<fieldset>
    <legend>Details for @Model.Name</legend>
    <div id="leftCol" class="column span-6">
        <div class="display-field">
            <img alt="@Model.Name" src="http://www.famouspeoplepool.com/_assets/images/hollywood-star.jpg" style="max-width: 230px" />
        </div>
        <h1>
            <a href="@Url.Action("Index", "Roster", new { id = Model.Id })">Create Roster</a>
        </h1>
        @Html.ActionLink("Back to Pools", "Index")
    </div>
    <div id="rightCol" class="column span-10 clearfix">
        <h1>@Model.Name</h1>
        <div class="display-label">@Html.LabelFor(model => Model.NumOfPeople)</div>
        <div class="display-field prepend-10px">@Html.Label(Model.NumOfPeople)</div>
        <div class="display-label">@Html.LabelFor(model => Model.DateStart)</div>
        <div class="display-field prepend-10px">@Html.Label(Model.DateStart)</div>
        <div class="display-label">@Html.LabelFor(model => Model.DateEnd)</div>
        <div class="display-field prepend-10px">@Html.Label(Model.DateEnd)</div>
        <div class="display-label">@Html.LabelFor(model => Model.WinRule)</div>
        <div class="display-field prepend-10px">@Html.Label(Model.WinRule)</div>
        <h2>
            Active Rosters</h2>
        <div class="span-10">
            @foreach (FPP.Models.User u in Model.Users)
            {
                var avaSource = (u.fb_user_id == null || u.fb_user_id == 0 ||  u.fbDisplayAvatar == false) ? "http://www.famouspeoplepool.com/_assets/images/hollywood-star.jpg" : string.Format("https://graph.facebook.com/{0}/picture", u.fb_user_id);
                var viewLink = Url.Action("View", "Roster", new { id = Model.Id, u = u.Id });
                <div class="clear column span-2">
                    <a href="@viewLink">
                        <img width="50" src="@avaSource"/>
                    </a>
                </div>
                <div class="column span-4 last">
                    <a href="@viewLink">@u.FirstName</a>
                    @if (u.LoginToken == HttpContext.Current.User.Identity.Name)
                    {
                        Write("(");
                        <a href="@Url.Action("Index", "Roster", new { id = Model.Id })">edit</a>
                        Write(")");
                    }
                </div>
            }
        </div>
    </div>
</fieldset>
